<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的心意 - 向你表白</title>
    <style>
        /* 全局样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Arial', sans-serif;
        }

        body {
            background: linear-gradient(135deg, #ffe8e8, #f8d7ff);
            color: #5a3d5c;
            min-height: 100vh;
            overflow-x: hidden;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .container {
            max-width: 800px;
            width: 100%;
            background-color: rgba(255, 255, 255, 0.9);
            border-radius: 20px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
            overflow: hidden;
            position: relative;
            z-index: 1;
        }

        /* 页眉样式 */
        header {
            text-align: center;
            padding: 30px 20px;
            background: linear-gradient(to right, #ff9ec0, #d64d7e);
            color: white;
        }

        h1 {
            font-size: 2.8rem;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
            margin-bottom: 10px;
            animation: fadeIn 2s ease;
        }

        .subtitle {
            font-size: 1.2rem;
            opacity: 0.9;
        }

        /* 主要内容区域 */
        main {
            padding: 30px;
        }

        /* 心形容器 */
        .heart-container {
            text-align: center;
            margin: 20px 0;
        }

        .heart {
            font-size: 5rem;
            color: #ff4d8d;
            display: inline-block;
            animation: heartbeat 1.5s infinite;
            cursor: pointer;
            transition: transform 0.3s;
            text-shadow: 0 0 20px rgba(255, 77, 141, 0.6);
        }

        .heart:hover {
            transform: scale(1.2);
        }

        /* 消息容器 */
        .message-container {
            text-align: center;
            margin: 30px 0;
            padding: 0 10px;
        }

        .message {
            font-size: 1.3rem;
            line-height: 1.6;
            margin-bottom: 20px;
            opacity: 0;
            animation: fadeIn 1s forwards;
        }

        .message:nth-child(1) { animation-delay: 0.5s; }
        .message:nth-child(2) { animation-delay: 1.5s; }
        .message:nth-child(3) { animation-delay: 2.5s; }

        .confession {
            font-size: 2.5rem;
            font-weight: bold;
            color: #d64d7e;
            margin: 30px 0;
            opacity: 0;
            animation: fadeIn 1s 3.5s forwards, pulse 2s infinite 4.5s;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }

        /* 按钮容器 */
        .button-container {
            display: flex;
            justify-content: center;
            gap: 25px;
            margin-top: 40px;
        }

        button {
            padding: 15px 35px;
            border: none;
            border-radius: 50px;
            font-size: 1.2rem;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: bold;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        #yes-btn {
            background: linear-gradient(to right, #ff6b9c, #ff4d8d);
            color: white;
        }

        #yes-btn:hover {
            background: linear-gradient(to right, #ff4d8d, #e6005c);
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(230, 0, 92, 0.3);
        }

        #no-btn {
            background: linear-gradient(to right, #b8b8b8, #999);
            color: white;
        }

        #no-btn:hover {
            background: linear-gradient(to right, #999, #777);
            transform: translateY(-3px);
        }

        /* 页脚样式 */
        footer {
            text-align: center;
            padding: 25px 0;
            background-color: #f9f0ff;
            color: #888;
            font-size: 0.95rem;
        }

        /* 飘落的心形 */
        .floating-heart {
            position: fixed;
            font-size: 1.8rem;
            color: #ff9ec0;
            opacity: 0.7;
            z-index: 0;
            user-select: none;
            pointer-events: none;
            animation: fall linear forwards;
        }

        /* 动画定义 */
        @keyframes heartbeat {
            0% { transform: scale(1); }
            50% { transform: scale(1.15); }
            100% { transform: scale(1); }
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        @keyframes fall {
            to {
                transform: translateY(100vh) rotate(360deg);
                opacity: 0;
            }
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            h1 {
                font-size: 2.2rem;
            }
            
            .heart {
                font-size: 4rem;
            }
            
            .message {
                font-size: 1.1rem;
            }
            
            .confession {
                font-size: 2rem;
            }
            
            .button-container {
                flex-direction: column;
                align-items: center;
                gap: 15px;
            }
            
            button {
                width: 80%;
                padding: 14px;
            }
        }

        @media (max-width: 480px) {
            body {
                padding: 10px;
            }
            
            .container {
                border-radius: 15px;
            }
            
            header {
                padding: 20px 15px;
            }
            
            h1 {
                font-size: 1.8rem;
            }
            
            .subtitle {
                font-size: 1rem;
            }
            
            main {
                padding: 20px 15px;
            }
            
            .heart {
                font-size: 3.5rem;
            }
            
            .confession {
                font-size: 1.7rem;
                margin: 20px 0;
            }
            
            button {
                font-size: 1.1rem;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <h1>致我心中的特别之人</h1>
            <p class="subtitle">这份心意，只为你存在</p>
        </header>
        
        <main>
            <div class="heart-container">
                <div class="heart" id="main-heart">❤</div>
            </div>
            
            <div class="message-container">
                <p class="message">从遇见你的那一刻起，我的世界便有了不同的色彩。</p>
                <p class="message">每一天，每一刻，我的心中都充满对你的思念。</p>
                <p class="message">今天，我想鼓起勇气告诉你：</p>
                <p class="confession">我喜欢你！</p>
            </div>
            
            <div class="button-container">
                <button id="yes-btn">我也喜欢你</button>
                <button id="no-btn">再考虑一下</button>
            </div>
        </main>
        
        <footer>
            <p>用心制作 · 只为特别的你</p>
        </footer>
    </div>
    
    <script>
        // 等待DOM加载完成
        document.addEventListener('DOMContentLoaded', function() {
            // 获取元素
            const mainHeart = document.getElementById('main-heart');
            const yesBtn = document.getElementById('yes-btn');
            const noBtn = document.getElementById('no-btn');
            
            // 创建飘落的心形
            function createFloatingHearts() {
                setInterval(() => {
                    const heart = document.createElement('div');
                    heart.classList.add('floating-heart');
                    heart.innerHTML = '❤';
                    heart.style.left = Math.random() * 100 + 'vw';
                    heart.style.fontSize = (Math.random() * 25 + 15) + 'px';
                    heart.style.opacity = Math.random() * 0.5 + 0.3;
                    heart.style.animationDuration = (Math.random() * 5 + 5) + 's';
                    
                    document.body.appendChild(heart);
                    
                    // 移除心形元素以避免内存泄漏
                    setTimeout(() => {
                        heart.remove();
                    }, 10000);
                }, 300);
            }
            
            // 主心形点击效果
            mainHeart.addEventListener('click', function() {
                this.style.animation = 'none';
                void this.offsetWidth; // 触发重绘
                this.style.animation = 'heartbeat 1.5s infinite';
                
                // 创建爆炸心形效果
                for (let i = 0; i < 20; i++) {
                    const miniHeart = document.createElement('div');
                    miniHeart.classList.add('floating-heart');
                    miniHeart.innerHTML = '❤';
                    miniHeart.style.position = 'fixed';
                    miniHeart.style.left = '50%';
                    miniHeart.style.top = '50%';
                    miniHeart.style.fontSize = '1.8rem';
                    miniHeart.style.color = '#ff4d8d';
                    miniHeart.style.opacity = '1';
                    miniHeart.style.transition = 'all 1s ease-out';
                    miniHeart.style.transform = `translate(-50%, -50%)`;
                    miniHeart.style.animation = 'none';
                    
                    document.body.appendChild(miniHeart);
                    
                    // 随机方向散开
                    setTimeout(() => {
                        const angle = Math.random() * Math.PI * 2;
                        const distance = Math.random() * 200 + 100;
                        const x = Math.cos(angle) * distance;
                        const y = Math.sin(angle) * distance;
                        
                        miniHeart.style.transform = `translate(${x}px, ${y}px)`;
                        miniHeart.style.opacity = '0';
                        
                        // 移除元素
                        setTimeout(() => {
                            miniHeart.remove();
                        }, 1000);
                    }, 10);
                }
            });
            
            // "我也喜欢你"按钮点击事件
            yesBtn.addEventListener('click', function() {
                // 创建庆祝效果
                document.body.style.background = 'linear-gradient(135deg, #ffb8e0, #ff7bac)';
                
                // 更改消息
                const messageContainer = document.querySelector('.message-container');
                messageContainer.innerHTML = `
                    <p class="confession" style="animation: none; opacity: 1;">谢谢你！</p>
                    <p class="message" style="animation: none; opacity: 1;">这真是我收到过最美好的回应</p>
                    <p class="message" style="animation: none; opacity: 1;">期待与你的每一次相遇 ❤</p>
                `;
                
                // 隐藏按钮
                document.querySelector('.button-container').style.display = 'none';
                
                // 增加心形动画
                createIntenseHearts();
            });
            
            // "再考虑一下"按钮事件
            noBtn.addEventListener('click', function() {
                // 移动按钮（逃避效果）
                const moveBtn = () => {
                    const maxX = window.innerWidth - this.offsetWidth;
                    const maxY = window.innerHeight - this.offsetHeight;
                    const randomX = Math.floor(Math.random() * maxX);
                    const randomY = Math.floor(Math.random() * maxY);
                    
                    this.style.position = 'absolute';
                    this.style.left = randomX + 'px';
                    this.style.top = randomY + 'px';
                };
                
                moveBtn();
                
                // 添加鼠标悬停时继续移动的效果
                noBtn.addEventListener('mouseover', moveBtn);
                
                // 增加"再考虑一下"文本大小
                const messages = document.querySelectorAll('.message');
                if (messages.length > 0) {
                    messages[messages.length - 1].innerHTML = '请再给我一次机会！';
                    messages[messages.length - 1].style.fontSize = '1.5rem';
                    messages[messages.length - 1].style.color = '#ff4d8d';
                    messages[messages.length - 1].style.fontWeight = 'bold';
                }
            });
            
            // 创建更密集的心形效果
            function createIntenseHearts() {
                setInterval(() => {
                    const heart = document.createElement('div');
                    heart.classList.add('floating-heart');
                    heart.innerHTML = '❤';
                    heart.style.left = Math.random() * 100 + 'vw';
                    heart.style.fontSize = (Math.random() * 25 + 15) + 'px';
                    heart.style.color = '#ff4d8d';
                    heart.style.opacity = Math.random() * 0.7 + 0.3;
                    heart.style.animationDuration = (Math.random() * 3 + 2) + 's';
                    
                    document.body.appendChild(heart);
                    
                    // 移除心形元素
                    setTimeout(() => {
                        heart.remove();
                    }, 8000);
                }, 100);
            }
            
            // 启动飘落的心形
            createFloatingHearts();
        });
    </script>
</body>
</html>